{{extend "layout_admin.html"}}

{{block css}}
<link href="{{=url_for_static('sb-admin-v2/css/plugins/morris/morris-0.4.3.min.css')}}" rel="stylesheet">
{{end}}

{{block title}}
<i class="fa fa-coffee fa-fw"></i> 项目统计
{{end}}

{{block content}}
<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title"><i class="fa fa-bar-chart-o fa-fw"></i> 所有项目  <b><u>BUG状况</u></b></h3>
    </div>
    <div class="panel-body">
        <div id="morris-all-bug-chart"></div>
    </div>
</div>
<hr>
<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title"><i class="fa fa-bar-chart-o fa-fw"></i> 最近2周 各项目  <b><u>BUG变化</u></b></h3>
    </div>
    <div class="panel-body">
        <div class="row">
            <div class="col-lg-3">
                <div class="list-group" id="project-bug-trend">
                    {{i = 0}}
                    {{for pb in project_bugs:}}
                    {{ i+=1 }}
                    {{if i == 1:}}
                    <a class="list-group-item active" onclick="bug_trend_change_project(this, {{=pb['project_id']}});">
                        <span class="badge">{{=pb["bug_count"]}}</span>
                        {{=pb["project_name"]}}
                    </a>
                    {{else:}}
                    <a class="list-group-item" onclick="bug_trend_change_project(this, {{=pb['project_id']}});">
                        <span class="badge">{{=pb["bug_count"]}}</span>
                        {{=pb["project_name"]}}
                    </a>
                    {{pass}}
                    {{pass}}
                </div>
            </div>
            <div class="col-lg-9">
                <div id="morris-bug-change-chart"></div>
            </div>
        </div>
    </div>
</div>
<hr>
<div class="panel panel-info">
    <div class="panel-heading">
        <h3 class="panel-title"><i class="fa fa-bar-chart-o fa-fw"></i> 各项目  <b><u>BUG分类</u></b></h3>
    </div>
    <div class="panel-body">
        <div class="row">
            <div class="col-lg-3">
                <div class="list-group" id="project-bug-types">
                    {{i = 0}}
                    {{for pb in project_bugs:}}
                    {{ i+=1 }}
                    {{if i == 1:}}
                    <a class="list-group-item active" onclick="bug_type_change_project(this, {{=pb['project_id']}});">
                        <span class="badge">{{=pb["bug_count"]}}</span>
                        {{=pb["project_name"]}}
                    </a>
                    {{else:}}
                    <a class="list-group-item" onclick="bug_type_change_project(this, {{=pb['project_id']}});">
                        <span class="badge">{{=pb["bug_count"]}}</span>
                        {{=pb["project_name"]}}
                    </a>
                    {{pass}}
                    {{pass}}
                </div>
            </div>
            <div class="col-lg-4">
                <div id="morris-bug-state-chart"></div>
            </div>
            <div class="col-lg-4">
                <div id="morris-bug-import-chart"></div>
            </div>
        </div>
    </div>
</div>
<hr>
{{end}}

{{block js}}
<script src="{{=url_for_static('chujue-js/chujue_validate.js')}}"></script>
<script src="{{=url_for_static('chujue-js/chujue_ajax.js')}}"></script>
<script src="{{=url_for_static('sb-admin-v2/js/plugins/morris/morris.js')}}"></script>
<script src="{{=url_for_static('sb-admin-v2/js/plugins/morris/raphael-2.1.0.min.js')}}"></script>
<script type="text/javascript" src="{{=url_for_static('views_statistics_admin/project_statistics.js')}}"></script>
<script type="text/javascript">
    $(function(){
        $("#li-statistics").children("ul").addClass("collapse in"); // 当前 menu 不折叠
        
        init_all_chart();
    });
</script>
{{end}}


